package cn.javass.dp.decorator.example6;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class LogDecorator extends Decorator{


    public LogDecorator(GoodsSaleEbi ebi) {
        super(ebi);
    }

    @Override
    public boolean sale(String user, String customer, SaleModel saleModel) {
        boolean f = this.ebi.sale(user, customer, saleModel);
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
        System.out.println("日志记录"+user+ "于"+df.format(new Date()));
        return f;
    }
}
